Skip to content

Refactor Muon optimizer constructors - #6147

Draft
janEbert wants to merge 5 commits into
NVIDIA:mainfrom
janEbert:muon-init-refactor
Draft

Refactor Muon optimizer constructors#6147
janEbert wants to merge 5 commits into
NVIDIA:mainfrom
janEbert:muon-init-refactor

Conversation

@janEbert

Copy link
Copy Markdown
Contributor
  • I, the PR author, have personally reviewed every line of this PR.

What does this PR do?

Refactor TensorParallelMuon.__init__ method, so that the shared functionality can be reused by TensorParallelAdaptiveMuon.__init__. We can then initialize TensorParallelAdaptiveMuon using AdaptiveMuon.__init__ instead of TensorParallelMuon.__init__, which means we don't need to copy-paste new features from Emerging-Optimizers into the constructor every so often.

I also improve the typing by using the type aliases that emerging_optimizers provides.

Based on #5321.

FDecaYed added 2 commits July 29, 2026 18:24
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
@janEbert
janEbert requested review from a team as code owners July 30, 2026 11:14
@svcnvidia-nemo-ci
svcnvidia-nemo-ci marked this pull request as draft July 30, 2026 11:14
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically converted to draft because all PRs must start as drafts.

When you are ready for review, click Ready for Review to begin the review process. This will:

  1. Add the oncall reviewer (optional reviewer)
  2. Add required review teams based on your changes

See the contribution guide for more details.

@copy-pr-bot

copy-pr-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@janEbert janEbert changed the title Muon init refactor Refactor Muon optimizer initialization Jul 30, 2026
@janEbert
janEbert force-pushed the muon-init-refactor branch from c673f0b to a352ff5 Compare July 30, 2026 11:48
janEbert added 3 commits July 30, 2026 13:50
Signed-off-by: janEbert <janpabloe@nvidia.com>
Now uses a utility function that can be shared with other optimizers
that need similar functionality.

Signed-off-by: janEbert <janpabloe@nvidia.com>
Now uses shared `TensorParallelMuon` initialization code using the
`_tp_muon_pre_init` function. Instead of using
`TensorParallelMuon.__init__`, we now use `AdaptiveMuon.__init__` so
that we don't need to regularly copy-paste new functionality from the
`AdaptiveMuon` initialization function.

Signed-off-by: janEbert <janpabloe@nvidia.com>
@janEbert
janEbert force-pushed the muon-init-refactor branch from a352ff5 to 93c94ab Compare July 30, 2026 12:01
@janEbert janEbert changed the title Refactor Muon optimizer initialization Refactor Muon optimizer constructors Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants